import React from 'react';
import '../style.css';


class Details extends React.Component {
    constructor(props){
        super(props)
        this.state = {
            details:{}
        }
    }

    render() {
        return (
            <div className="details_container">
                <div className="details_img">
                    <img src={this.state.details.productImage} alt=""/>
                </div>
                <div className="details_message">
                    <div className="details_message_wrapper">
                        <div className="details_title">
                            {this.state.details.productName}
                        </div>
                        <div className="details_price">
                            ￥{this.state.details.salePrice}.00元
                        </div>
                    </div>
                </div>

            </div>
        )
    }
    componentDidMount() {
        console.log(this.props.location.query.data)
        this.setState({
            details:this.props.location.query.data
        })
    }
}

export default Details